/*
 * @Author: kenan
 * @Date: 2022-09-22 15:55:25
 * @LastEditors: kenan
 * @LastEditTime: 2022-09-22 16:14:06
 * @FilePath: /smartide-server/web/src/utils/page.js
 * @Description: 
 * 
 * Copyright (c) 2022 by kenanlu@leansoftx.com, All Rights Reserved. 
 */
import config from '@/core/config'
import { getConf } from '@/api/smartideConf'

export default async function getPageTitle (pageTitle) {
  let res = await getConf()
  if (res && res.code == 0) {
    if (pageTitle && res.data.title) {
      return `${pageTitle} - ${res.data.title}`
    }
    return res.data.title
  } else {
    if (pageTitle) {
      return `${pageTitle} - ${config.appName}`
    }
    return `${config.appName}`
  }

}
